<script language="JavaScript" type="text/javascript">
{literal}
function onOK()
{
alert(window.field_name);
}
{/literal}
</script>
<button onclick="onOK();">OK</button>
